Borland Online And The Cobb Group Present:


January, 1994 - Vol. 1 No. 1

Customizing the IDE - Changing the default project settings

You probably build most of your applications with the same compiler and linker options. For example, you may always build applications using the large memory model and pre-compiled headers.

If you regularly use non-standard compiler settings, a memory model other than small, or paths that differ from the default settings, you may have to change these parameters each time you start a new project. Fortunately, you can determine the default settings for these options in new projects. In this article, we'll show you how to save your favorite project options as default settings.

The default project file

The Borland C++ Integrated Development Environment (IDE) stores all the default compiler options, the default paths, and the default memory model in the default project file, TCDEF.DPR (TCDEFW.DPR for the Windows-hosted IDE). The IDE stores this project file in the IDE's home directory (typically, \BORLANDC\BIN).

To change the default options for new projects, we'll first close any existing project file that may be open. Otherwise, the IDE will save any changes we make to project-related options in the open project's PRJ file.

Next, we'll set our compiler options and paths, and then select a memory model. These settings are going to become the defaults for all new projects, so we'll need to be sure we choose settings appropriate for most of our projects.

Finally, we'll save the new project options. If there isn't an open project file when you save project settings, the IDE puts those settings in the default project file. Now, let's change the default options for new projects.

Changing your default SETTINGs

To begin, we'll launch the Windows version of the IDE. When the main IDE window opens, make sure there isn't an open project. As Figure A shows, when a project file is open, the IDE enables the Close Project command in the Project menu.

Figure A - You'll need to close an open project file before you can change the default project settings.

If another project file is open, choose Close Project from the Project menu to close it. Now you'll be able to save your new project options to the default project file.

Now, choose Compiler from the Options menu, and then choose Code Generation… from the Compiler submenu. Click the Large radio button in the Model section to specify the new default memory model. Then, select the Pre-compiled Headers and Duplicate Strings Merged check boxes from the Options section to specify the new compiler settings. When you finish making these changes, the Code Generation Options dialog box should resemble the one shown in Figure B.


Figure B - You set the memory model and general compiler options from the Code Generation Options dialog box.

Click the OK button to close this dialog box. Your project changes are now in the compiler's memory. For these changes to take effect, you'll need to save them to the project's disk file.

Choose Save… from the Options menu. When the Save Options dialog box appears, deselect the Environment and Desktop check boxes, and leave the Project check box selected, as shown in Figure C.


Figure C - You save the current project settings from the Save Options dialog box.

Click the OK button to save your project options to the default project file. Now, let's create a new project that uses our customized default options.

Using the new default SETTINGs

Choose Open Project… from the Project menu. When the Open Project File dialog box appears, enter TEST.PRJ in the File Name text box, as shown in Figure D.


Figure D - New projects will now use your custom project defaults.

Choose Compiler from the Options menu, and then choose Code Generation… from the Compiler submenu. When the Code Generation Options dialog box appears, confirm that the new memory model and compiler settings are in effect for this project.

Click the Cancel button to close this dialog box, and then choose Close Project from the Project menu to close the new project file. Choose Exit from the File menu to shut down the IDE.

Conclusion

The default project options in the Borland C++ IDE are frequently inappropriate for new projects. In this article, we showed you how to modify the default project file. By using this technique, you can start each new project with your favorite project-related options.

Return to the Borland C++ Developer's Journal index

Subscribe to the Borland C++ Developer's Journal


Copyright (c) 1996 The Cobb Group, a division of Ziff-Davis Publishing Company. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff-Davis Publishing Company is prohibited. The Cobb Group and The Cobb Group logo are trademarks of Ziff-Davis Publishing Company.